from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    #搜索1
    def sousuo1(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索菜谱")')
        ele=self.find_ele(loc)
        return ele

    # 搜索2
    def sousuo2(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele

    # 输入内容
    def shuru(self):
        loc=(By.ID,'com.xiachufang:id/search_edit_text')
        ele=self.find_ele(loc)
        return ele

    # 点击按钮
    def anniu(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.find_ele(loc)
        return ele
    # 断言方法
    def df(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/common_first_text" and @text="超下饭的麻婆豆腐"]')
        ele=self.find_ele(loc)
        return ele